{% extends "./blog/base.html"%}
 
{% block main%}

{% url 'user-view' 'notification' as notification_url %}

<div style="height:80px;"></div>
<div class="row">
    <div class="col-md-2">
        {%include "./blog/user_left.html"%}
    </div>
    <div class="col-md-10">
    	<div class="panel">
        <table class="table table-striped table-condensed text-center">
		  
		  <thead>
		    <tr>
		      <th>编号</th>
		      <th>标题</th>
		      <th>分类</th>
		      <th>标签</th>
		      <th>状态</th>
		      <th>访问量</th>
		      <th>操作</th>
		  </tr>
		  </thead>
		  <tbody>
		  	{% for item in article_list %}
		    <tr>
		      <td>{{item.id}}</td>
		      <td>{{item.title}}</td>
		      <td>{{item.category}}</td>
		      <td>{{item.tags}}</td>
		      <td>{{item.status}}</td>
		      <td>{{item.view_times}}</td>
		      <td>
		      	<div class="btn-group">
				    <button type="button" class="btn btn-default" onclick=window.location.href="/blog/article/{{item.id}}.html?column={{request.session.column}}">查看</button>
				    <button type="button" class="btn btn-default" onclick=window.location.href="/blog/publish.html?id={{item.id}}&column={{request.session.column}}">修改</button>
				    <button type="button" class="btn btn-default" data-toggle="modal" data-target="#myModal" onclick="delete_id.value={{item.id}}">删除</button>
				 </div>
		      </td>
		  	</tr>
		  	{% endfor %}
		   
		  </tbody>
		</table>
		</div>
    </div>
</div>
<script type="text/javascript">
 $("#article").addClass("active")
</script>
<form class="form-horizontal" enctype="multipart/form-data" role="form" method="post" action="" >
	{% csrf_token %}
<!-- 模态框（Modal） -->
<div class="modal fade" id="myModal" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" aria-hidden="true">
    <div class="modal-dialog">
        <div class="modal-content">
            <div class="modal-header">
                <button type="button" class="close" data-dismiss="modal" aria-hidden="true">&times;</button>
                <h4 class="modal-title" id="myModalLabel">确认删除</h4>
            </div>
            <div class="modal-body">
            	你是否确认删除？
            	<input type="text" name="delete_id" id="delete_id" style="display:none">
            </div>
            <div class="modal-footer">
                <button type="button" class="btn btn-default" data-dismiss="modal">关闭</button>
                <button type="submit" class="btn btn-primary">提交更改</button>
            </div>
        </div><!-- /.modal-content -->
    </div><!-- /.modal -->
</div>
</form>
{%endblock%}
